/* GUI CONVERTED from ptsuiq.p (converter v1.75) Sun Aug 13 13:49:40 2000 */
/* ptsuiq.p - SUBSTITUTE PART INQUIRY                                   */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* web convert ptsuiq.p (converter v1.00) Mon Mar 09 10:51:44 1998 */
/* web tag in ptsuiq.p (converter v1.00) Mon Mar 09 10:51:31 1998 */
/*F0PN*/ /*K1KV*/ /*                                                    */
/*V8:ConvertMode=Report                                        */
/* REVISION: 6.0     LAST EDIT: 03/01/90   MODIFIED BY: EMB             */
/* Revision: 7.3     Last edit: 11/19/92            By: jcd *G339*  */
/* Revision: 7.3     Last edit: 12/09/93            By: ais *GH70*  */
/* Revision: 7.5     Last edit: 03/14/95            By: dzs *J046*  */
/* REVISION: 8.5     LAST MODIFIED: 11/19/96        BY: *H0PG* Suresh Nayak */
/* REVISION: 8.6E    LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E    LAST MODIFIED: 03/09/98   BY: *K1KV* Beena Mol         */
/* REVISION: 8.6E    LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan        */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/13/00 BY: *N0KQ* myb                */


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

     {mfdtitle.i "b+ "} /*GH70*/

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE ptsuiq_p_1 "Comments"
/* MaxLen: Comment: */

&SCOPED-DEFINE ptsuiq_p_2 "Parent/Base"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

     define buffer ptmstr for pt_mstr.
/*GH70*/ define variable temp like mfc_logical.

     
/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
        pts_part
/*J046      pts_part   */
/*J046*/    pts_par label {&ptsuiq_p_2}
        pts_sub_part
     with frame a no-underline width 80 attr-space THREE-D /*GUI*/.

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



     /* SET EXTERNAL LABELS */
     setFrameLabels(frame a:handle).

/*K1KV*/ {wbrp01.i}

     repeat:

/*K1KV*/ if c-application-mode <> 'web' then

        prompt-for
        pts_part validate (true,"")
        pts_par  validate (true,"")
        pts_sub_part validate (true,"")
        with frame a editing:

/*GH70*        if frame-field = "pts_item" then do:         */
/*GH70*/       if frame-field = "pts_part" then do:

          /* FIND NEXT/PREVIOUS RECORD */
          {mfnp.i pts_det pts_part pts_part pts_part pts_part pts_det}

          if recno <> ? then do with frame a:
             display pts_part.
          end.
          recno = ?.
           end.
           else if frame-field = "pts_par" then do:

          /* FIND NEXT/PREVIOUS RECORD */
          {mfnp.i pts_det pts_par pts_par pts_par pts_par pts_par}

          if recno <> ? then do with frame a:
             display pts_par.
          end.
          recno = ?.
           end.
/*GH70*        else if frame-field = "pts_sub_item" then do:      */
/*GH70*/       else if frame-field = "pts_sub_part" then do:

          /* FIND NEXT/PREVIOUS RECORD */
          {mfnp.i pts_det pts_sub_part pts_sub_part
           pts_sub_part pts_sub_part pts_sub_part}

          if recno <> ? then do with frame a:
             display pts_sub_part.
          end.
          recno = ?.
           end.
           else do:
          status input.
          readkey.
          apply lastkey.
           end.
        end.

/*K1KV*/ {wbrp06.i &command = prompt-for &fields = "  pts_part
          validate ( true ,'') pts_par validate ( true ,'')
          pts_sub_part validate ( true ,'')" &frm = "a"}

/*K1KV*/ if (c-application-mode <> 'web') or
/*K1KV*/ (c-application-mode = 'web' and
/*K1KV*/ (c-web-request begins 'data')) then do:

        status input.

        hide frame b.
        hide frame c.
        hide frame d.
        hide frame f.
        hide frame e.

/*K1KV*/ end.

        /* SELECT PRINTER */
        {mfselprt.i "terminal" 80}

        if input pts_part > "" then
        for each pts_det no-lock using pts_part
        where (pts_par = input pts_par or input pts_par = "")
        and   (pts_sub_part = input pts_sub_part or input pts_sub_part = "")
        with frame b width 80 no-attr-space down:
                /* SET EXTERNAL LABELS */
                setFrameLabels(frame b:handle).
                
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
                     /*G339*/

           find pt_mstr no-lock where pt_part = pts_sub_part no-error.

/*GH70*/       temp = (pts_cmtindx <> 0).
           display pts_par
/*J046*/       label {&ptsuiq_p_2}
           pts_sub_part pts_qty_per
           pt_um when (available pt_mstr)
           pts_rmks
/*GH70*        (pts_cmtindx <> 0) label "Comments".      */
/*GH70*/       temp label {&ptsuiq_p_1} WITH STREAM-IO /*GUI*/ .

        end.
        else
        if input pts_par > "" then
        for each pts_det no-lock using pts_par
        where (pts_sub_part = input pts_sub_part or input pts_sub_part = "")
        with frame c width 80 no-attr-space down:
                /* SET EXTERNAL LABELS */
                setFrameLabels(frame c:handle).
                
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
                     /*G339*/

           find pt_mstr no-lock where pt_part = pts_sub_part no-error.

/*GH70*/       temp = (pts_cmtindx <> 0).
           display pts_part pts_sub_part pts_qty_per
           pt_um when (available pt_mstr)
           pts_rmks
/*GH70*        (pts_cmtindx <> 0) label "Comments".      */
/*GH70*/       temp label {&ptsuiq_p_1} WITH STREAM-IO /*GUI*/ .

        end.
        else
        if input pts_sub_part > "" then
        for each pts_det no-lock using pts_sub_part
        with frame d width 80 no-attr-space down:
                /* SET EXTERNAL LABELS */
                setFrameLabels(frame d:handle).
                
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
                     /*G339*/

           find pt_mstr no-lock where pt_part = pts_sub_part no-error.

/*GH70*/       temp = (pts_cmtindx <> 0).
           display pts_par
/*J046*/       label {&ptsuiq_p_2}
           pts_part pts_qty_per
           pt_um when (available pt_mstr)
           pts_rmks
/*GH70*        (pts_cmtindx <> 0) label "Comments".      */
/*GH70*/       temp label {&ptsuiq_p_1} WITH STREAM-IO /*GUI*/ .

        end.
        else do:

/*H0PG**       find first pts_det no-lock no-error.                      */
/*H0PG*/       find first pts_det where pts_det.pts_part >= ""
/*H0PG*/                          and   pts_det.pts_par >= ""
/*H0PG*/                          and   pts_det.pts_sub_part >= ""
/*H0PG*/                          no-lock no-error.

           repeat:
          if not available pts_det then leave.

          find pt_mstr no-lock where pt_part = pts_part no-error.
          if available pt_mstr then do
          with frame f width 80 no-attr-space side-labels:

             /* SET EXTERNAL LABELS */
             setFrameLabels(frame f:handle).
             display pt_part pt_desc1 no-label pt_um WITH STREAM-IO /*GUI*/ .

             for each pts_det no-lock
             where pts_part = pt_part
             with frame e width 80 no-attr-space down:
                /* SET EXTERNAL LABELS */
                setFrameLabels(frame e:handle).
                
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
                     /*G339*/

            find ptmstr no-lock
            where ptmstr.pt_part = pts_sub_part no-error.

/*GH70*/                temp = (pts_cmtindx <> 0).
            display pts_par
/*J046*/                label {&ptsuiq_p_2}
            pts_sub_part pts_qty_per
            pts_rmks
/*GH70*                 (pts_cmtindx <> 0) label "Comments" with frame e. */
/*GH70*/                temp label {&ptsuiq_p_1} with frame e STREAM-IO /*GUI*/ .
             end.
          end.
/*H0PG**          find next pts_det no-lock no-error.                     */
/*H0PG*/          find next pts_det where pts_det.pts_part >= ""
/*H0PG*/                            and   pts_det.pts_par >= ""
/*H0PG*/                            and   pts_det.pts_sub_part >= ""
/*H0PG*/                            no-lock no-error.
           end.
        end.

        {mfreset.i}
/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

        {mfmsg.i 8 1}
     end.

/*K1KV*/ {wbrp04.i &frame-spec = a}
